<?php
namespace BP\Sys;

use BP\En\EntityMyPK;

require_once("BP/En/Map.php");
class FrmLine extends EntityMyPK {
	public function getBorderColorHtml () 
	{
		return PubClass::ToHtmlColor($this->getBorderColor());
	}
	public function getBorderColor () 
	{
		return $this->GetValStringByKey("BorderColor");
	}
	public function setBorderColor ($value) // [String value]
	{
		$this->SetValByKey(FrmLineAttr::$BorderColor, $value);
	}
	public function getBorderWidth () 
	{
		return $this->GetValFloatByKey(FrmLineAttr::$BorderWidth);
	}
	public function setBorderWidth ($value) // [float value]
	{
		$this->SetValByKey(FrmLineAttr::$BorderWidth, $value);
	}
	public function getGUID () 
	{
		return $this->GetValStrByKey(FrmLineAttr::$GUID);
	}
	public function setGUID ($value) // [String value]
	{
		$this->SetValByKey(FrmLineAttr::$GUID, $value);
	}
	public function getY1 () 
	{
		return $this->GetValFloatByKey(FrmLineAttr::$Y1);
	}
	public function setY1 ($value) // [float value]
	{
		$this->SetValByKey(FrmLineAttr::$Y1, $value);
	}
	public function getX1 () 
	{
		return $this->GetValFloatByKey(FrmLineAttr::$X1);
	}
	public function setX1 ($value) // [float value]
	{
		$this->SetValByKey(FrmLineAttr::$X1, $value);
	}
	public function getFK_MapData () 
	{
		return $this->GetValStrByKey(FrmLineAttr::$FK_MapData);
	}
	public function setFK_MapData ($value) // [String value]
	{
		$this->SetValByKey(FrmLineAttr::$FK_MapData, $value);
	}
	public function getY2 () 
	{
		return $this->GetValFloatByKey(FrmLineAttr::$Y2);
	}
	public function setY2 ($value) // [float value]
	{
		$this->SetValByKey(FrmLineAttr::$Y2, $value);
	}
	public function getX2 () 
	{
		return $this->GetValFloatByKey(FrmLineAttr::$X2);
	}
	public function setX2 ($value) // [float value]
	{
		$this->SetValByKey(FrmLineAttr::$X2, $value);
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public function getEnMap () 
	{
		if (($this->get_enMap() != NULL))
		{
			return $this->get_enMap();
		}
		$map = new Map("Sys_FrmLine", "�?");
		$map->Java_SetDepositaryOfEntity($Depositary->None);
		$map->Java_SetDepositaryOfMap($Depositary->Application);
		$map->Java_SetEnType($EnType->Sys);
		$map->IndexField = FrmImgAthDBAttr::$FK_MapData;
		$map->AddMyPK();
		$map->AddTBString(FrmLineAttr::$FK_MapData, NULL, "主表",  TRUE ,  FALSE , 0, 100, 20);
		$map->AddTBFloat(FrmLineAttr::$X1, 5, "X1",  TRUE ,  FALSE );
		$map->AddTBFloat(FrmLineAttr::$Y1, 5, "Y1",  FALSE ,  FALSE );
		$map->AddTBFloat(FrmLineAttr::$X2, 9, "X2",  FALSE ,  FALSE );
		$map->AddTBFloat(FrmLineAttr::$Y2, 9, "Y2",  FALSE ,  FALSE );
		$map->AddTBFloat("X", 9, "X",  FALSE ,  FALSE );
		$map->AddTBFloat("Y", 9, "Y",  FALSE ,  FALSE );
		$map->AddTBFloat(FrmLineAttr::$BorderWidth, 1, "宽度",  FALSE ,  FALSE );
		$map->AddTBString(FrmLineAttr::$BorderColor, "black", "颜色",  TRUE ,  FALSE , 0, 30, 20);
		$map->AddTBString(FrmLineAttr::$GUID, NULL, "初始的GUID",  TRUE ,  FALSE , 0, 128, 20);
		$this->set_enMap($map);
		return $this->get_enMap();
	}
	public function IsExitGenerPK () 
	{
		$sql = ((((((((((("SELECT COUNT(*) FROM " . $this->getEnMap()->getPhysicsTable()) . " WHERE FK_MapData='") . $this->getFK_MapData()) . "' AND x1=") . $this->getX1()) . " and x2=") . $this->getX2()) . " and y1=") . $this->getY1()) . " and y2=") . $this->getY2());
		if ((DBAccess->RunSQLReturnValInt($sql, 0) == 0))
		{
			return  FALSE ;
		}
		return  TRUE ;
	}
}
?>
